<?php if (count($this->pagesInRange) > 1) { ?>
    <div class="pagination1">
       <nav>
               
            
        <ul class="pagination">
         <?php if(!empty($this->search_by)){ ?>
            <?php if ($this->current != 1) { ?>
                <li><a href="<?php echo $this->url('pagesfrontend',array('page'=> $this->first,'search_by' => $this->search_by));?>" title="Trang đầu"><i class="fa fa-angle-double-left"></i>
                </a></li>
            <?php } ?>
            <?php if ($this->previous) { ?>
                <li><a href="<?php echo $this->url('pages',array('page'=> $this->previous,'search_by' => $this->search_by));?>" title="Lùi lại"><i class="fa fa-angle-left"></i>
                </a></li>
            <?php } ?>

            <?php foreach ($this->pagesInRange as $page) { ?>
                <li <?php echo $page == $this->current ? 'class="active"' : ''; ?> id="page_<?php echo $page; ?>">
                    <a href="<?php echo $this->url('pagesfrontend',array('page'=> $page,'search_by' => $this->search_by));?>"><?php echo $page; ?></a>
                </li>
            <?php } ?>

            <?php if ($this->next) { ?>
                <li><a href="<?php echo $this->url('pages',array('page'=> $this->next,'search_by' => $this->search_by));?>" title="Tiếp theo"><i class="fa fa-angle-right"></i>
                </a></li>
            <?php } ?>
            <?php if ($this->current != $this->last) { ?>
                <li><a href="<?php echo $this->url('pages',array('page'=> $this->last,'search_by' => $this->search_by));?>" title="Trang Cuối"><i class="fa fa-angle-double-right"></i>
                </a></li>
                <?php } ?> 
             <?php }else{ ?>

                <li <?php echo $this->previous ? 'class="active"' : 'class="disabled"'; ?>><a href="<?php echo $this->previous ? $this->url('pagesfrontend',array('page'=> $this->previous)): '#'?>" title="Lùi lại">Cũ hơn
                </a></li>

                <li <?php echo $this->next ? 'class="active"' : 'class="disabled"'; ?>><a href="<?php echo $this->next ? $this->url('pagesfrontend',array('page'=> $this->next)): '#'?>" title="Tiếp theo">Mới hơn
                </a></li>
 
             <?php } ?>
        </ul>
        </nav>
    </div>
<?php } ?> 
<?php echo $this->serach?>